#define _CRT_SECURE_NO_WARNINGS 1 
#include<stdio.h>
int main()
{
	char buf[31] = { 0 };
	scanf("%[^\n]s", buf);
	int i = 0;

	while (buf[i])
	{
		if (buf[i] >= 'a' && buf[i] <= 'z')
			buf[i] -= 32;
		else if (buf[i] >= 'A' && buf[i] <= 'Z')
			buf[i] += 32;
		i++;
	}
	printf("%s",buf);


	return 0;
}